package com.core.zyyz.amc.modules.service.impl;

import java.util.List;

import com.core.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.core.zyyz.amc.modules.mapper.AmcProjectNodeMapper;
import com.core.zyyz.amc.modules.domain.AmcProjectNode;
import com.core.zyyz.amc.modules.service.AmcProjectNodeService;

/**
 * 节点配置Service业务层处理
 *
 * @author LiuFushun
 * @date 2024-11-20
 */
@Service
public class AmcProjectNodeServiceImpl implements AmcProjectNodeService
{
    @Autowired
    private AmcProjectNodeMapper amcProjectNodeMapper;

    /**
     * 查询节点配置
     *
     * @param nodeId 节点配置主键
     * @return 节点配置
     */
    @Override
    public AmcProjectNode selectAmcProjectNodeByNodeId(String nodeId)
    {
        return amcProjectNodeMapper.selectAmcProjectNodeByNodeId(nodeId);
    }

    /**
     * 查询节点配置
     *
     * @param nodeCode 节点编码
     * @return 节点配置
     */
    @Override
    public AmcProjectNode selectAmcProjectNodeByNodeCode(String nodeCode)
    {
        return amcProjectNodeMapper.selectAmcProjectNodeByNodeCode(nodeCode);
    }

    /**
     * 查询节点配置列表
     *
     * @param amcProjectNode 节点配置
     * @return 节点配置
     */
    @Override
    public List<AmcProjectNode> selectAmcProjectNodeList(AmcProjectNode amcProjectNode)
    {
        return amcProjectNodeMapper.selectAmcProjectNodeList(amcProjectNode);
    }

    /**
     * 新增节点配置
     *
     * @param amcProjectNode 节点配置
     * @return 结果
     */
    @Override
    public int insertAmcProjectNode(AmcProjectNode amcProjectNode) {
        amcProjectNode.setNodeId(UUID.randomUUID().toString());
        return amcProjectNodeMapper.insertAmcProjectNode(amcProjectNode);
    }

    /**
     * 修改节点配置
     *
     * @param amcProjectNode 节点配置
     * @return 结果
     */
    @Override
    public int updateAmcProjectNode(AmcProjectNode amcProjectNode)
    {
        return amcProjectNodeMapper.updateAmcProjectNode(amcProjectNode);
    }

    /**
     * 批量删除节点配置
     *
     * @param nodeIds 需要删除的节点配置主键
     * @return 结果
     */
    @Override
    public int deleteAmcProjectNodeByNodeIds(String[] nodeIds)
    {
        return amcProjectNodeMapper.deleteAmcProjectNodeByNodeIds(nodeIds);
    }

    /**
     * 删除节点配置信息
     *
     * @param nodeId 节点配置主键
     * @return 结果
     */
    @Override
    public int deleteAmcProjectNodeByNodeId(String nodeId)
    {
        return amcProjectNodeMapper.deleteAmcProjectNodeByNodeId(nodeId);
    }
}
